package com.cn.boot.student.controller.student.team;

import com.cn.boot.student.entity.DispatchRecordEntity;
import com.cn.boot.student.service.team.ITeamDisPatch;
import com.cn.boot.student.util.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author luosir
 * 小组调度记录控制器
 */
@RestController
@RequestMapping("/admin/teamDispatch")
@Api(tags = "小组调度记录接口")
public class TeamDispatchRecordController {
    @Autowired
    private ITeamDisPatch iTeamDisPatch;

    /**
     * 调度记录列表
     * @param dispatchRecordEntity
     * @return
     */
    @PostMapping("/findAll")
    @PreAuthorize("hasAuthority('sys:team:read')")
    @ApiOperation(value = "调度记录列表")
    public CommonResult findAll(DispatchRecordEntity dispatchRecordEntity){
        return iTeamDisPatch.findAll(dispatchRecordEntity);
    }

    /**
     * 调度记录删除
     * @param id
     * @return
     */
    @DeleteMapping("/del")
    @PreAuthorize("hasAuthority('sys:team:del')")
    @ApiOperation(value = "调度记录删除")
    public CommonResult del(Integer id){
        return iTeamDisPatch.del(id);
    }
}
